package com.yyl.fmall.user.interceptor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @BelongsProject: fmall
 * @BelongsPackage: com.yyl.fmall.user.interceptor
 * @Author: YuanSir
 * @CreateTime: 2022-11-04  14:17
 * @Description:
 * @Version: 1.0
 */

@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    
    @Autowired
    private TokenInterceptor tokenInterceptor;
    
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        
        registry.addInterceptor(tokenInterceptor)   //注册拦截器
                .addPathPatterns("/index/indeximg");    //配置拦截器拦截路径
        
    }
}
